package com.ql.boot.dubbo.web.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.ql.boot.dubbo.api.DemoProvider;
import com.ql.boot.dubbo.entity.Demo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by gs on 2017/5/19 0019.
 */
@RestController
public class DemoController {

    @Reference(interfaceClass = DemoProvider.class, protocol = "dubbo", version = "1.0")
    private DemoProvider demoProvider;

    @RequestMapping("")
    public Demo getDemo(Integer id) {

        return demoProvider.getById(id);
    }
}
